// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi 
// Source File Name:   SignPO.java

package com.vandagroup.security;

import com.vandagroup.common.bean.FormBean;
import com.vandagroup.common.po.CosPO;
import java.sql.*;

// Referenced classes of package com.vandagroup.security:
//            SignFormBean

public class SignPO extends CosPO
{

    SignFormBean formBean;

    public SignPO()
    {
        formBean = new SignFormBean();
    }

    public SignFormBean getSignForm()
    {
        return formBean;
    }

    public void setSignForm(SignFormBean formBean)
    {
        this.formBean = formBean;
    }

    public FormBean fetchResult(ResultSet rs)
        throws SQLException
    {
        SignFormBean bean = new SignFormBean();
        bean.setId(new Integer(rs.getInt("ID")));
        bean.setUserName(rs.getString("USERNAME"));
        bean.setSignDate(rs.getDate("SIGNDATE"));
        bean.setSignType(rs.getString("SIGNTYPE"));
        bean.setSignText(rs.getString("SIGNTEXT"));
        bean.setSignStat(rs.getString("SIGNSTAT"));
        return bean;
    }

    public String getColumnNames()
    {
        return "ID, USERNAME, SIGNDATE, SIGNTYPE, SIGNTEXT, SIGNSTAT";
    }

    public String getInsertValuesString()
    {
        return "?, ?, ?, ?, ?, ?";
    }

    public String getTableName()
    {
        return "SIGN";
    }

    public String getUpdateValuesString()
    {
        return "ID=?, USERNAME=?, SIGNDATE=?, SIGNTYPE=?, SIGNTEXT=?, SIGNSTAT=?";
    }

    public void prepareInsertStatement(PreparedStatement ps)
        throws SQLException
    {
        prepareSetInt(ps, 1, formBean.getId());
        ps.setString(2, formBean.getUserName());
        ps.setDate(3, formBean.getSignDate());
        ps.setString(4, formBean.getSignType());
        ps.setString(5, formBean.getSignText());
        ps.setString(6, formBean.getSignStat());
    }

    public void prepareUpdateStatement(PreparedStatement ps)
        throws SQLException
    {
        prepareSetInt(ps, 1, formBean.getId());
        ps.setString(2, formBean.getUserName());
        ps.setDate(3, formBean.getSignDate());
        ps.setString(4, formBean.getSignType());
        ps.setString(5, formBean.getSignText());
        ps.setString(6, formBean.getSignStat());
    }
}
